//
//  SIStatus.swift
//  SinaImiate
//
//  Created by xiaoming on 16/7/2.
//  Copyright © 2016年 GoodJob. All rights reserved.
//

import UIKit
import YYModel

class SIStatus: NSObject {
    
    ///转发数
    var reposts_count: Int = 0
    ///评论数
    var comments_count: Int = 0
    ///点赞数
    var attitudes_count: Int = 0
    
    ///uid
    var id: Int64 = 0
    ///微博信息内容
    var text: String?
    ///微博的用户 - 注意和服务器返回的 key 要一致
    var user: SIUser?
    
    ///图片数组
    var pic_urls: [SIStatusPicture]?
    ///微博配图模型数组
    var retweeted_status: SIStatus?
    
    ///微博创建时间字符串
    var created_at: String? {
        didSet {
            createDate = Date.cz_sinaDate(string: created_at ?? "")
            
        }
    }
    
    var createDate: Date?
    ///微博来源- 发布微博使用的客户端
    var source: String? {
        didSet {
            
            ///设置来源字符串
            source = "来自" + (source?.cz_href()?.text ?? "")
        }
    }
    
    
    /// 重写description
    override var description: String {
        
        return yy_modelDescription()
    }
    
    class func modelContainerPropertyGenericClass() -> [String: AnyClass] {
        
        return ["pic_urls": SIStatusPicture.self]
    }
}
